package dao

import (
	"time"
)

// 这是 Customer 的全局公开dao对象
var CustomerDao = customerDao{}

// 这是 customer表 的实体类
type Customer struct {
	Id          int       `json:"id" form:"id" binding:"id"`
	CreatedAt   time.Time `json:"created_at" form:"created_at" binding:"created_at"`
	UpdatedAt   time.Time `json:"updated_at" form:"updated_at" binding:"updated_at"`
	DeletedAt   time.Time `json:"deleted_at" form:"deleted_at" binding:"deleted_at"`
	Name        string    `json:"name" form:"name" binding:"name"`                         // 客户名
	Phone       string    `json:"phone" form:"phone" binding:"phone"`                      // 客户手机号
	UserId      int       `json:"user_id" form:"user_id" binding:"user_id"`                // 管理员ID
	AuthorityId string    `json:"authority_id" form:"authority_id" binding:"authority_id"` // 管理员角色ID
}

// 注意:这是 Customer 的私有dao对象
type customerDao struct {
	Obj    Customer
	Insert func(arg Customer) int      //插入一条记录
	Update func(arg Customer) int      //更新一条记录
	Delete func(arg Customer) int      //删除一条记录
	Select func(arg Customer) Customer //获取一条记录
}
